<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
</head>
<body>
<form action="">
  <input type="file" id="file">
</form>
<button id="btn">测试
</button>
<script>
  document.querySelector('#btn').addEventListener('click', function () {
    console.log(typeof document.querySelector('#file').files);
  });
</script>
</body>
</html>